Skip to content

Feat/registries auth implementation#370

Closed
Leay15 wants to merge 64 commits intosuperradcompany:mainfrom
AurIAL-Rocks:feat/registries-auth-implementation
Closed

Feat/registries auth implementation#370
Leay15 wants to merge 64 commits intosuperradcompany:mainfrom
AurIAL-Rocks:feat/registries-auth-implementation

Conversation

@Leay15
Copy link
Copy Markdown

@Leay15 Leay15 commented Feb 10, 2026

This pull request refers to #364 introduces robust support for registry authentication in the microsandbox CLI and core library, allowing users to securely pull and push images from private registries.

It adds new CLI commands for login/logout, implements environment and stored credential resolution, and integrates these mechanisms into image operations.

Documentation is updated to reflect these new features and usage patterns.

All test are passing OK

Registry Authentication Features

  • Added new CLI commands: msb login and msb logout for managing registry credentials, including support for username/password and token-based authentication, with credentials stored locally in ~/.microsandbox/registry_auth.json. [1] [2]
  • Implemented environment variable support for registry credentials (MSB_REGISTRY_USERNAME, MSB_REGISTRY_PASSWORD, MSB_REGISTRY_TOKEN), with clear priority: environment variables override stored credentials, and both are used for authentication when pulling/pushing images. [1] [2]

Core Library Enhancements

  • Introduced resolve_registry_auth and related utilities in microsandbox-core/lib/oci/auth.rs, providing normalization, host resolution, and credential lookup logic, including comprehensive tests for all resolution scenarios.
  • Integrated registry authentication into image pulling logic, passing resolved credentials to the registry client and updating relevant constructors and mocks. [1] [2] [3] [4] [5]

Documentation and Testing

  • Updated CLI documentation with examples and security notes for authentication workflows, including environment variable usage and credential storage warnings. [1] [2]
  • Added integration and unit tests for registry auth resolution, covering environment, stored, and fallback scenarios. [1] [2]

Utilities and Re-exports

  • Added new environment variable constants and dependencies to support credential management and serialization. [1] [2]
  • Re-exported registry auth resolution utilities for compatibility and easier access in management modules. [1] [2] [3] [4]

These changes collectively provide a secure, flexible, and user-friendly registry authentication system for microsandbox users.

Leay15 added 28 commits February 9, 2026 19:51
@Leay15
Copy link
Copy Markdown
Author

Leay15 commented Feb 14, 2026

@toksdotdev All the modifications were addressed according to your feedback.

I'll be waiting for any further comments.

Copy link
Copy Markdown
Member

@toksdotdev toksdotdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm sorry, but i have quite a number of reservations with this MR. it seems to me most of these were generated by AI, and hardly underwent much human review. while i'm not against AI generated code (i use it as well, i'm against humans not spending enough time reviewing their code). the implication of that is, most of the responsibilities are shifted to the reviewer which i don't think is great.

i definitely appreciate the contribution, but please spend time reviewing your changes before putting it up for review. i'm also up for discussing approaches in the github thread before implementation. that way, we can avoid multiple back-and-forths.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you create this as a separate PR after this is merged. makes it easier to review and test.

@Leay15
Copy link
Copy Markdown
Author

Leay15 commented Feb 15, 2026

@toksdotdev, thank you so much for your feedback. I'll be working on it.

Please excuse the AI ​​code, which appears unreviewed. I'm still learning from the code I review and the feedback I've received. I can assure you that I don't upload code that I haven't reviewed, tested, and that doesn't make sense to me. Therefore, I greatly appreciate your comments and support in continuing to improve.

Leay15 and others added 18 commits February 15, 2026 13:49
…ion' into feat/registries-auth-implementation
@Leay15
Copy link
Copy Markdown
Author

Leay15 commented Feb 15, 2026

@toksdotdev all modifications done 😄

In the registry.rs file, I couldn't decouple the resolve_auth function in the tests because OciClient was causing a panic. I ran out of ideas and for now, I've implemented a wrapper function to test the behavior.

I'm open to suggestions if there's a better way I'm missing and welcome any comments.

Thank you again for all your patience and the kind comments you give me

@Leay15
Copy link
Copy Markdown
Author

Leay15 commented Feb 15, 2026

While testing directly with the keychain, I've encountered a bug that I'll be working on. Nothing from the login is being saved. I've already tested the pull method using ENV vars, and that works correctly.

imagen

@Leay15
Copy link
Copy Markdown
Author

Leay15 commented Feb 16, 2026

The bug was fixed 😄 , just I need to know if we have to add windows support for keyring or just Linux and MacOs

@toksdotdev
Copy link
Copy Markdown
Member

hey @Leay15. apologies i didn't get back on this. a lot of things have changed, and there's now auth support in the latest version. i'll proceed to close this now, but please do feel free to let me know if you've got other ideas in mind.

@toksdotdev toksdotdev closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants